package com.zondy.mapgis.explorer;


import android.app.Service;
import android.os.Environment;
import android.os.Vibrator;

import com.zondy.mapgis.android.activity.MapActivity;
import com.zondy.mapgis.android.base.BaseApplication;
import com.zondy.mapgis.android.service.LocationService;

/**
 * 整个应用程序Applicaiton
 * 
 * @author FJL
 * @version 1.0
 * 
 */
public class MapApplication extends BaseApplication
{
	/** 手机sdcard路径 **/
	public static final String PHONE_SDCARD_PATH = Environment.getExternalStorageDirectory().getPath();
	/** 系统库路径 **/
	public static String SystemLibraryPath = PHONE_SDCARD_PATH + "/MapGIS Explorer/";
	/** 地图数据路径 **/
	private String MapDataPath = FilePathCfg.GOOGLE_FILE_PATH;
	/**百度定位服务**/
	public LocationService locationService;
    public Vibrator mVibrator;
    /**TracksRecordSettingFrag中定位参数是否被设置**/
    public boolean IsRecodSetting = false;
	/** 地图Activity **/
	private MapActivity mapActivity;
	/** 地图Application **/
	private static MapApplication app;
	private Class<? extends BaseMapActivity> mapActivityClass;

	@Override
	public void onCreate()
	{
		super.onCreate();
		app = this;
		
		com.zondy.mapgis.android.environment.Environment.initialize(SystemLibraryPath, this);

//		com.zondy.mapgis.android.environment.Environment.setRootPath(SystemLibraryPath);
//		MapInitializer.initialize(this);
		/***
         * 初始化定位sdk，建议在Application中创建
         */
        locationService = new LocationService(getApplicationContext());
        mVibrator =(Vibrator)getApplicationContext().getSystemService(Service.VIBRATOR_SERVICE);
	}

	public static MapApplication getApp()
	{
		return app;
	}

	public static void setApp(MapApplication app)
	{
		MapApplication.app = app;
	}

	public MapActivity getMapActivity()
	{
		return mapActivity;
	}

	public void setMapActivity(MapActivity mapActivity)
	{
		this.mapActivity = mapActivity;
	}

	public String getSystemLibraryPath()
	{
		return SystemLibraryPath;
	}

	public void setSystemLibraryPath(String systemLibraryPath)
	{
		SystemLibraryPath = systemLibraryPath;
	}

	public String getMapDataPath()
	{
		return MapDataPath;
	}

	public void setMapDataPath(String mapDataPath)
	{
		MapDataPath = mapDataPath;
	}

	public Class<? extends BaseMapActivity> getMapActivityClass()
	{
		return mapActivityClass;
	}

	public void setMapActivityClass(Class<? extends BaseMapActivity> mapActivityClass)
	{
		this.mapActivityClass = mapActivityClass;
	}
	
	public boolean isIsRecodSetting()
	{
		return IsRecodSetting;
	}

	public void setIsRecodSetting(boolean isRecodSetting)
	{
		IsRecodSetting = isRecodSetting;
	}


}
